#ifndef _SCOLL_UV_PASS_
#define _SCOLL_UV_PASS_

struct Attributes {
    float3 positionOS :  POSITION;
    float2 texcoord   :  TEXCOORD0;
};

struct Varyings {
    float4 positionCS : SV_POSITION;
    float2 uv         : TEXCOORD0;
};

Varyings vert( Attributes IN)
{
    Varyings OUT = (Varyings)0;
    VertexPositionInputs vertexInput = GetVertexPositionInputs(IN.positionOS);
    OUT.positionCS = vertexInput.positionCS;
    OUT.uv = TRANSFORM_TEX(IN.texcoord, _BaseMap);
    return OUT;
}

float4 frag( Varyings IN) : SV_TARGET
{
    float4 OUT;
    float2 flowUV = SAMPLE_TEXTURE2D_X(_FlowMap, sampler_FlowMap, IN.uv);
    float2 uv = FlowUV(IN.uv, flowUV, _ScrollSpeed, _Time.y);
    float4 color = SAMPLE_TEXTURE2D_X(_BaseMap, sampler_BaseMap, uv);
    return color;

}





#endif